﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Gedea.Model.Entities
{
    public class Customer
    {

        #region Properties

        //Que no lo vea. Es interno del programa.
        //[Browsable(false)] //sacar?
        public int CustomerId { get; set; }

        //Lo que se le cante mientras sea de menos de 100
        [Required(AllowEmptyStrings = false, ErrorMessage = "First name is required")]
        [StringLength(100, ErrorMessage = "The name must have less than 100 characters")]
        //[DisplayName("Zapato")]
        public string RealName { get; set; }

        //22 - identificadorcliente (NroDeDocumento o legajo) Solo numeros (pero configurable a string)
        [Required(AllowEmptyStrings = false, ErrorMessage = "The name for the bank is required")]
        [StringLength(22, ErrorMessage = "The name for the bank must have less than 22 characters")]
        public string IdForBank { get; set; }

        //22 IML
        [Required(AllowEmptyStrings = false, ErrorMessage = "The name for the bank is required")]
        [StringLength(22, ErrorMessage = "The cbu must have less than 22 characters")]
        public string Cbu { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "The area is required")]
        public int AreaId { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "The user is required")]
        public int UserId { get; set; }

        //Fecha vencimiento
        public DateTime ExpirationDate;

        //Importe (los ultimos dos son centavos)
        public decimal Amount = 1234567800; //IML


        #endregion

        //private void DoSomething()
        //{
        //    Contact contact = new Contact { FirstName = "Armin", LastName = "Zia", Birthday = new DateTime(1988, 04, 20) };

        //    ValidationContext context = new ValidationContext(contact, null, null);
        //    IList<ValidationResult> errors = new List<ValidationResult>();

        //    if (!Validator.TryValidateObject(contact, context, errors, true))
        //    {
        //        foreach (ValidationResult result in errors)
        //            MessageBox.Show(result.ErrorMessage);
        //    }
        //    else
        //        MessageBox.Show("Validated");
        //}

    }
}
